/*
 * @Description:
 * @Version: 2.0
 * @Autor: yangzg
 * @Date: 2022-08-26 09:50:56
 * @LastEditors: wangmiao
 * @LastEditTime: 2022-08-31 10:25:45
 */

import { useEffect } from 'react'
import { useNavigate } from 'react-router-dom'

interface Props {
  to: string
}

export function Redirect({ to }: Props) {
  let navigate = useNavigate()
  useEffect(() => {
    navigate(to)
  })
  return null
}
